package support;

import java.util.*;

/*********************************************************
 * DegreeContainer
 * Keeps track of all degree objects
 * Keeps track of removing all degree objects
 * Keeps track of when to add new degree objects to the
 * container.
 * Only one DegreeContiainer must exist per session.
 ********************************************************/
public class DegreeContainer{
	public DegreeContainer(){
		degreeCount = 0;
		isMoreDegrees = false;
		degrees = new LinkedList<degree>();
	}
	
	public degree getLastDegree(){
		return (degree)degrees.peekLast();
	}
	
	public void addDegree(){
		degree d = new degree(degreeCount);
		degrees.add(degreeCount, d);
		
		degreeCount++;
	}
	
	public degree getDegree(int num){
		return (degree)degrees.get(num);
	}
	
	public int getSize(){
		return degreeCount;
	}
	
	public boolean isMoreDegrees(){
		return isMoreDegrees;
	}
	
	public void setIsMoreDegrees(boolean b){
		isMoreDegrees = b;
	}
	
/*********************************
 * private class variables
 *********************************/
	private int degreeCount;
	private LinkedList<degree> degrees;
	private boolean isMoreDegrees;
	
}
